import re
from datetime import datetime
from typing import List, Optional
from pydantic import BaseModel, Field, validator, EmailStr, IPvAnyAddress

from enum import Enum

class AuditInspectionResult(str, Enum):
    success = 'success'
    failed = 'failed'



class DelBaseModel(BaseModel):
    uuid: int = Field(..., description="数据的uuid")


class PostAuditEvent(BaseModel):
    user_name: str = Field(..., description="用户名称")
    event_name: str = Field(..., description="事件名称")
    event_type: str = Field(..., description="事件类型")
    is_notice: bool = Field(1, description="通知到企业微信群:1(通知) or 0(不通知)")
    comment: str = Field(..., max_length=1023, description="事件说明")



class PostAuditInspection(BaseModel):
    user_name: str = Field(..., description="巡检人")
    inspection_name: str = Field(..., description="巡检名称")
    inspection_type: str = Field(..., description="巡检类型")
    inspection_result: AuditInspectionResult = Field(AuditInspectionResult.success, description="巡检结果")
    is_notice: bool = Field(1, description="通知到企业微信群:1(通知) or 0(不通知)")
    comment: str = Field(..., max_length=1023, description="巡检说明")